package java_demos.java_basic.instance_demos.about_string;

public class SearchLastString {
    public static void main(String[] args) {
        /*
        * 通常使用lastIndextOf()方法查找子字符串在指定字符串中出现的最后位置
        * */
        String strOrign = "Hello world,Hello Runoob";
        int lastIndex = strOrign.lastIndexOf("Runoob");
        if(lastIndex==-1){
            System.out.println("没有找到字符串Runoob");
        }else{
            System.out.println("字符串Runoob出现的最后位置为："+lastIndex);
        }

    }
}
